#include <cstdio>
#include <cstring>

int main( )
{
    char data[ 60 ];
    int i, l, p = 1;
    while ( scanf("%s", data) )
    {
        if ( strcmp( data, "STOP" ) == 0 )
            break;
        l = strlen( data );
        for ( i = 0; i < l; i++ )
            if ( data[ i ] != data[ l - i - 1 ] )
                break;
        printf("#%d: ", p++);
        if ( i < l )
            puts("NO");
        else
            puts("YES");
    }
    return 0;
}
